package com.itheima.sh.clients;

import com.itheima.sh.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description:   服务提供方编写
 * @Version: V1.0
 */
@FeignClient(value = "user-service")   //, fallback = UserFeinFallBack.class
public interface UserFeign {

    // /{id}  ?key=value&
    @GetMapping("/user/{id}")
    public User queryById(@PathVariable("id") String username);

    @GetMapping("/user/list")
    public User list(@RequestParam("username") String username, @RequestParam(value = "name",required = false) String name);
}
